package com.jlkf.controller.website;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jlkf.service.WebsiteOrderItemsService;

@Controller
@RequestMapping("website")
public class WebsiteOrderItemsController {

	@Autowired
	private WebsiteOrderItemsService websiteOrderItemsService;
	
	//乘客订单列表
	@RequestMapping("getPassengerOrderList")
	public Object getPassengerOrderList(Integer pageNo, Integer pageSize, String orderNo, String startTime,
			String endTime,Long uId){
	  return websiteOrderItemsService.getPassengerOrderList(pageNo, pageSize, orderNo, startTime, endTime,uId);
	}
	//获取订单详情 我是乘客
	@RequestMapping("getOrderItemsDetails")
	public Object getOrderItemsDetails(Long orderId){
		return websiteOrderItemsService.getOrderItemsDetails(orderId);
	}
	//我是司机订单列表
	@RequestMapping("getOrderItemsDriverList")
	public Object getOrderItemsDriverList(Integer pageNo, Integer pageSize, String orderNo, String startTime,
			String endTime,Long driverId){
		return websiteOrderItemsService.getOrderItemsDriverList(pageNo, pageSize, orderNo, startTime, endTime,driverId);
	}
	
	   // 乘客下载订单
		@RequestMapping(value = "/downloadOrder")
		@ResponseBody
		public void downloadOrder(HttpServletResponse response,HttpServletRequest request,String userOrderNo,String orderNo, String startTime,
				String endTime,Long uId,Long driverId) {
		    websiteOrderItemsService.downloadOrder(response, request, userOrderNo, orderNo, startTime, endTime, uId,driverId);
		}
	//订单未完成时不显示推送
	@RequestMapping("pushEmail")
	public Object pushEmail(Long orderId,Integer type){
		return websiteOrderItemsService.pushEmail(orderId,type);
	}	
	//网站的模板列表
	@RequestMapping("getWebsiteFormworkList")
	public Object getWebsiteFormworkList(Integer pageNo,Integer pageSize,String formworkName){
		return websiteOrderItemsService.getWebsiteFormworkList(pageNo,pageSize,formworkName);
	}
	
	@RequestMapping("websiteDriverStatements")
	public Object websiteDriverStatements(Long driverId){
		return websiteOrderItemsService.websiteDriverStatements(driverId);
	}
	
 	//模板添加
	@RequestMapping("websiteFormworkAdd")
	public Object websiteFormworkAdd(@RequestBody String json){
		return websiteOrderItemsService.websiteFormworkAdd(json);
	}
	//网站企业优惠劵添加
	@RequestMapping("websiteCorporateCouponsAdd")
	public Object websiteCorporateCouponsAdd(@RequestBody String json){
		return websiteOrderItemsService.websiteCorporateCouponsAdd(json);
	}
	//企业优惠及列表
	@RequestMapping("getWebsiteCorporateCouponsList")
	public Object getWebsiteCorporateCouponsList(Integer pageNo,Integer pageSize,String telephone,String startTime,
			String endTime,Integer isUse,Long enterpriseId){
		return websiteOrderItemsService.getWebsiteCorporateCouponsList(pageNo,pageSize,telephone,startTime,endTime,isUse,enterpriseId);
	}
	
	@RequestMapping("getWebsiteCorporateCouponsCount")
	public Object getWebsiteCorporateCouponsCount(Long enterpriseId){
		return websiteOrderItemsService.getWebsiteCorporateCouponsCount(enterpriseId);
	}
	
	//城市下拉
	@RequestMapping("getCity")
	public Object getCity(){
		return websiteOrderItemsService.getCity();
	}
	
	
}
